pay = float(input('费用金额：'))
n = int(input('人数：'))
type = input("请选择分摊方式编号  1.平均分摊  2.比例分摊\n")

if type=='1':
    print(f'每人应付：{pay/n}')
elif type=='2':
    lst = []
    for i in range(n):
        t = int(input(f'比例{i+1}：'))
        lst.append(t)
    per = pay / sum(lst)
    id=1
    for i in lst:
        print(f'人员{id}：{per*i}')
        id+=1
